/*
 * IGAssociationImpl.java
 * Created on 25 sept. 2008
 *
 * Glacéo Internet Platform
 * http://sourceforge.net/projects/chm/
 *
 * Copyright (c) 2005-2008, Jens and Jan Janke (VirtualHockey Project)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hockeo.vhbase.data.impl;

import com.hockeo.vhbase.data.dao.IGDao;
import com.hockeo.vhbase.data.dao.assoc.GAssociation;
import com.hockeo.vhbase.data.dao.season.GSeason;

/**
 * Interface to be implemented by classes that define the logic for a hockey association.
 * An assocation specific implementation is especially responsible for carrying out league
 * promotions and relegations at the beginning of a new season.
 *
 * @version $Id$
 * @author jjanke
 */
public interface IGAssociationImpl
{
  /**
   * Sets the DAO to be used for database interactions.
   *
   * @param dao the DAO to be set
   */
  public void setDao( IGDao dao );

  /**
   * Assigns a seeding rank to all clubs of the specified association. The seeding rank is
   * determined by ranking all clubs according to their last season's league results. New
   * clubs will receive a seeding that corresponds to the seeding of the worst club from
   * the last year + 1.
   *
   * @param assoc the association for which to assign club seedings
   * @param season the current season
   */
  public void assignClubSeedings( final GAssociation assoc, final GSeason season );

  /**
   * Re-establishes the seedings based on the results of the before last season.
   *
   * @param assoc the association for which to undo club seeding assignments
   * @param season the current season
   */
  public void undoAssignClubSeedings( final GAssociation assoc, final GSeason season );

  /**
   * Executes the annual league promotions and relegations.
   *
   * @param assoc the association for which to carry out the promotions/relegations
   * @param season the current season
   */
  public void doLeaguePromotionsAndRelegations( final GAssociation assoc, final GSeason season );

  /**
   * Reverses the annual league promotions and relegations.
   *
   * @param assoc the association for which to reverse the promotions/relegations
   * @param season the current season
   */
  public void undoLeaguePromotionsAndRelegations( final GAssociation assoc, final GSeason season );
}
